﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="xsPage.aspx.cs" Inherits="xsPage" %>

<%@ Register assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.DynamicData" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body
        {
            margin: 0 auto;
            text-align:center;
            font-size: 12px;
        }
        table
        {
            border-collapse: collapse;
        }
        #divContainer
        {
        	margin: 0 auto;
            text-align:left;
            width: 770px;
        }
        #divTitle1
        {
            height: 25px;
            line-height: 25px;
            vertical-align: middle;
            background: url('images/bg_Title.jpg') repeat-x bottom;
        }
        .divTitle
        {
            height: 30px;
            line-height: 30px;
            vertical-align: middle;
        }
        .divTitle span
        {
            font-weight: bold;
        }
        #tblEdit
        {
            font-size: 12px;
            line-height: 30px;
            width: 100%;
        }
        .gvStyle, .gvStyle th, .gvStyle td
        {
            line-height: 19px;
            border: solid 1px black;
        }
        .gvStyle td table td
        {
            border: none;
        }
        a
        {
            color: Red;
        }
        a:visited
        {
            color: Red;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="divContainer">
        <div class="divTitle">
            <span>已有学生信息一览&gt;&gt;</span>
        </div>
        <div>
            <table style="width: 100%; line-height: 25px;">
                <tr>
                    <td>
                        院系：
                    </td>
                    <td>
                        <asp:DropDownList ID="dropYX" Width="200px" runat="server" DataTextField="yxName"
                            AutoPostBack="True" OnSelectedIndexChanged="dropYX_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td>
                        专业：
                    </td>
                    <td>
                        <asp:DropDownList ID="dropZY" Width="200px" runat="server" DataTextField="zyName"
                            OnSelectedIndexChanged="dropZY_SelectedIndexChanged" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                    <td>
                        我的班级：
                    </td>
                    <td>
                        <asp:DropDownList ID="dropBJ" Width="200px" runat="server" DataTextField="zyName"
                            AutoPostBack="True" onselectedindexchanged="dropBJ_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
        </div>
        <div id="divBrowse">
            <asp:GridView ID="gvXS" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                Font-Size="12px" PageSize="8" OnPageIndexChanging="gvXS_PageIndexChanging" OnRowDeleting="gvXS_RowDeleting"
                DataKeyNames="xsId" CssClass="gvStyle" Width="100%" 
                onselectedindexchanging="gvXS_SelectedIndexChanging">
                <RowStyle HorizontalAlign="Left" />
                <Columns>
                    <asp:BoundField DataField="bjName" HeaderText="班级名称">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="xsId" HeaderText="学号">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle Width="100px" HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="xsName" HeaderText="学生姓名">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle Width="150px" HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="xsSex" HeaderText="学生性别">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle Width="55px" HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="xsIdCard" HeaderText="身份证号码">
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:CommandField ShowSelectButton="True" ShowDeleteButton="True">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle Width="55px" HorizontalAlign="Center" />
                    </asp:CommandField>
                </Columns>
                <FooterStyle HorizontalAlign="Left" />
                <SelectedRowStyle BackColor="#CCFFFF" />
            </asp:GridView>
        </div>
        <div class="divTitle">
            <span>维护已有学生信息或添加新的学生信息>></span>
        </div>
        <div id="divEdit">
            <table id="tblEdit">
                <tr>
                    <td style="width: 60px;">
                        当前班级：
                    </td>
                    <td>
                        <asp:Label ID="labBJ" runat="server" Text="[请选择班级]"></asp:Label>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="vertical-align: top; width: 60px;">
                        学生学号：
                    </td>
                    <td>
                        <asp:TextBox ID="txtXH" Width="250px" runat="server"
                            Font-Size="12px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                            ControlToValidate="txtXH" Display="Dynamic" ErrorMessage="请输入15位以内数字型学号！" 
                            MaximumValue="999999999999999" MinimumValue="0" Type="Double">请输入15以内数字型学号！</asp:RangeValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="txtXH" Display="Dynamic" ErrorMessage="请输入学生学号！">请输入学生学号！</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top; width: 60px;">
                        学生姓名：
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" Width="250px" runat="server"
                            Font-Size="12px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtName" Display="Dynamic" ErrorMessage="请输入姓名！">请输入姓名！</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top; width: 60px;">
                        身份证号：
                    </td>
                    <td>
                        <asp:TextBox ID="txtCard" runat="server" Width="250px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                            ControlToValidate="txtCard" Display="Dynamic" ErrorMessage="请输入正确的身份证号码！" 
                            ValidationExpression="\d{17}[\d|X]|\d{15}">请输入正确的身份证号码！</asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtCard" Display="Dynamic" ErrorMessage="请输入身份证号码！">请输入身份证号码！</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top; width: 60px;">
                        学生性别：
                    </td>
                    <td>
                        <asp:DropDownList ID="dropSex" runat="server">
                            <asp:ListItem Value="1">男</asp:ListItem>
                            <asp:ListItem Value="0">女</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 60px;">
                        <asp:Button ID="btnRefur" runat="server" Text="添加" OnClick="btnRefur_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCancel" runat="server" Text="取消" OnClick="btnCancel_Click" />&nbsp;&nbsp;（一次添加多个时，请换行！请确保每项对应！）
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
